Note: this disassembly pertains to an already hacked binary!

808828D0	0	
ADDIU	SP,SP,FFE8
SW	RA,0014 (SP)
LW	T6,002C (A0)
LUI	T9,0001
ADDU	T9,T9,T6
LW	T9,06A8 (T9)
JALR	RA,T9
NOP
//808828F0:	return
LW	RA,0014 (SP)
ADDIU	SP,SP,0018
JR	RA
NOP

80882900	30	
ADDIU	SP,SP,FFE8
SW	RA,0014 (SP)
OR	A2,A1,R0
LW	V1,002C (A0)
LUI	AT,0001
ORI	AT,AT,0358
ADDU	V0,V1,AT
LW	T6,0030 (V0)
ADDIU	AT,R0,0004
LUI	T9,0001
BNE	T6,AT,80882944
ADDU	T9,T9,V1
LW	T9,06B0 (T9)
OR	A0,A2,R0
ADDIU	A1,R0,0004
JALR	RA,T9
NOP
//80882944:	return
LW	RA,0014 (SP)
ADDIU	SP,SP,0018
JR	RA
NOP

80882954	84	
ADDIU	SP,SP,FFE8
SW	RA,0014 (SP)
LW	T6,002C (A0)
LUI	T9,0001
ADDU	T9,T9,T6
LW	T9,06AC (T9)
JALR	RA,T9
NOP
//80882974:	return
LW	RA,0014 (SP)
ADDIU	SP,SP,0018
JR	RA
NOP

80882984	B4	
ADDIU	SP,SP,FFD0
SW	RA,001C (SP)
SW	S0,0018 (SP)
LW	S0,002C (A0)
LUI	T9,0001
SW	A0,0030 (SP)
ADDU	T9,T9,S0
LW	T9,0124 (T9)
JALR	RA,T9
NOP
//808829AC:	
LUI	AT,0001
ORI	AT,AT,0118
ADDU	A1,S0,AT
SW	A1,0020 (SP)
LW	T6,0004 (A1)
LUI	T9,8088
LW	A0,0030 (SP)
SLL	T7,T6,0x2
ADDU	T9,T9,T7
LW	T9,3100 (T9)	;T9=80883100+offset: p->handler
JALR	RA,T9
NOP
//808829DC:	
LW	A1,0020 (SP)
LUI	AT,0001
LW	A0,0030 (SP)
LW	V0,0004 (A1)
ADDU	AT,AT,S0
BEQL	V0,R0,80882A38
SW	R0,06A0 (AT)
ADDIU	AT,R0,0002
BNEL	V0,AT,80882A3C
LW	RA,001C (SP)
LW	T8,002C (A0)
LUI	T0,0001
ADDU	T0,T0,T8
LW	T0,06D8 (T0)
LW	T9,0124 (T0)
JALR	RA,T9
NOP
//80882A20:	
LUI	AT,0001
ADDU	AT,AT,S0
ADDIU	T1,R0,0001
BEQ	R0,R0,80882A38
SW	T1,06A0 (AT)
//80882A34:	
SW	R0,06A0 (AT)
//80882A38:	return
LW	RA,001C (SP)
LW	S0,0018 (SP)
ADDIU	SP,SP,0030
JR	RA
NOP

80882A4C	17C	
ADDIU	SP,SP,FFD0
LUI	AT,4180
MTC1	AT,F12		;F12=16.0: top row multiplier	[41800000]
SW	RA,0014 (SP)
SW	A0,0030 (SP)
SW	A1,0034 (SP)
SW	A2,0038 (SP)
SW	A3,003C (SP)
LW	T6,0034 (SP)
LUI	AT,8000
MOV.S	F14,F12		;F14=F12: 16.0: middle row multiplier
LW	T7,0028 (T6)
LUI	A2,3F80		;A2=1.0: bottom row multiplier	[3F800000]
OR	A3,R0,R0	;A3=0: mode ?
ADDU	T8,T7,AT	;T8=T7+80000000: rdram address extension
LUI	AT,8014
JAL	800E041C	;matrix conversion
SW	T8,58D0 (AT)	;T8->801458D0: 
//80882A94:
LWC1	F12,0038 (SP)	;F12=SP+38: top row
LWC1	F14,003C (SP)	;F14=SP+3C: middle row
LUI	A2,430C		;A2=140.0: bottom row	[430C0000]
JAL	800E0314	;matrix conversion
ADDIU	A3,R0,0001	;A3=1: mode ?
//80882AA8:	rsp.moveword
LW	A0,0030 (SP)
LW	V1,0298 (A0)
LUI	T9,DB06
ORI	T9,T9,0030	;T9=DB060030 
OR	V0,V1,R0	;V0=V1: p->DL
SW	T9,0000 (V0)	;T9->DL+0: moveword.u: index 6, offset 30
LW	T0,0034 (SP)
ADDIU	V1,V1,0008	;V1+=8: next DL
OR	A1,V1,R0	;A1=V1: p->DL
LW	T1,0028 (T0)	;T1=T0+28: p->display list data
ADDIU	V1,V1,0008	;V1+=8: next DL
LUI	T2,DA38
SW	T1,0004 (V0)	;T1->DL+4: moveword.l: rdram offset
//80882ADC:	rsp.matrix
ORI	T2,T2,0003	;T2=DA380003
SW	T2,0000 (A1)	;T2->DL+0: matrix.u: modelview-load,nopush
SW	A1,0018 (SP)	;SP+18=A1: p->cur.DL
JAL	800E13C4	;V0=p->matrix
SW	V1,0024 (SP)	;SP+24=V1: p->DL
//80882AF0:	set matrix offset
LW	A1,0018 (SP)	;A1=p->cur.DL
LW	V1,0024 (SP)	;V1=p->DL
LUI	T3,DE00
SW	V0,0004 (A1)	;V0->DL+4: matrix.l: rdram offset
//80882B00:	rsp.displaylist
OR	V0,V1,R0	;V0=V1: p->DL
LUI	T4,0C00
ADDIU	T4,T4,0930	;T4=0C000930
SW	T4,0004 (V0)	;T4->DL+4: displaylist.l: rdram offset=800024C0
SW	T3,0000 (V0)	;T3->DL+0: displaylist.u
ADDIU	V1,V1,0008	;V1+=8: next DL
LW	T5,0030 (SP)
SW	V1,0298 (T5)	;V1->T5+298: update p->DL
//80882B20:	return
LW	RA,0014 (SP)
JR	RA
ADDIU	SP,SP,0030

80882B2C	25C	[803B802C]	displays message one row at a time
	accepts: A0=p->type controller, A1=p->manager, A2=(float)xpos, A3=(float)ypos
ADDIU	SP,SP,FF68
SDC1	F22,0048 (SP)
SDC1	F20,0040 (SP)
SW	S8,0090 (SP)
MTC1	A3,F20		;F20=A3: ypos
MTC1	A2,F22		;F22=A2: xpos
OR	S8,A1,R0	;S8=A1: p->manager
SW	RA,0094 (SP)
SW	S7,008C (SP)
SW	S6,0088 (SP)
SW	S5,0084 (SP)
SW	S4,0080 (SP)
SW	S3,007C (SP)
SW	S2,0078 (SP)
SW	S1,0074 (SP)
SW	S0,0070 (SP)
SDC1	F30,0068 (SP)
SDC1	F28,0060 (SP)
SDC1	F26,0058 (SP)
SDC1	F24,0050 (SP)
LUI	AT,4180
MTC1	AT,F30		;F30= 16.0	[41800000]
LUI	AT,42F0
MTC1	AT,F28		;F28= 120.0	[42F00000]
LUI	AT,4320
MTC1	AT,F26		;F26= 160.0	[43200000]
LUI	AT,3F80
MTC1	AT,F24		;F24= 1.0	[3F800000]
LW	S4,0024 (A0)	;S4=controller+24: p->text
LH	S1,001C (A0)	;S1=controller+1C: text.len
OR	S5,R0,R0	;S5=0	init.count.row
LW	S7,00AC (SP)
LW	S6,00A8 (SP)
ADDIU	S2,R0,00CD	;S2=0xCD: '\r'
//80882BB4:	loop to display each line
OR	S3,R0,R0	;S3=0	newline flag
BLEZ	S1,80882BF8	;skip parsing if no message to parse!
OR	S0,R0,R0	;S0=0: init count.str
ADDU	V0,S4,R0	;V0=S4: p->text
//80882BC4:	test for newlines
LBU	T6,0000 (V0)	;T6=text+0: char.cur
BNEL	S2,T6,80882BE0	;branch if not '\n'
ADDIU	S0,S0,0001
ADDIU	S0,S0,0001	;S0++	count.str+1
BEQ	R0,R0,80882BF8
ADDIU	S3,R0,0001	;S3=TRUE	newline found
//80882BDC:	test for message end
ADDIU	S0,S0,0001	;S0++	count.msg+1
SLTI	AT,S0,0010
BEQ	AT,R0,80882BF8	;branch if overran row (string over 16)
ADDIU	V0,V0,0001	;V0++	p->next char
SLT	AT,S0,S1
BNEL	AT,R0,80882BC8	;loop if not at end of message
LBU	T6,0000 (V0)
//80882BF8:	display line to screen
BEQ	S0,R0,80882CB0	;branch if blank line
OR	A0,S8,R0	;A0=S8: p->manager
MFC1	A3,F22		;A3=F22: xpos
ADDIU	T7,R0,005A
ADDIU	T8,R0,000A
ADDIU	T9,R0,0082
ADDIU	T0,R0,00FF
SW	T0,0020 (SP)	;SP+20=FF: alpha
SW	T9,001C (SP)	;SP+1C=82: blue
SW	T8,0018 (SP)	;SP+18=A: green
SW	T7,0014 (SP)	;SP+14=5A: red
OR	A1,S4,R0	;A1=S4: p->text
OR	A2,S0,R0	;A2=S0: text.len
SWC1	F20,0010 (SP)	;SP+10=F20: ypos
SW	R0,0024 (SP)	;SP+24=0
SW	R0,0028 (SP)	;SP+28=0
SWC1	F24,002C (SP)	;SP+2C=1.0
SWC1	F24,0030 (SP)	;SP+30=1.0
JAL	80090E98	;print text to screen
SW	R0,0034 (SP)	;SP+34=0
//80882C48:	compute {x,y} at end of message
SUBU	S1,S1,S0	;S1-=S0: text.len-count.str
BNE	S1,R0,80882CB0	;branch if more message remains
ADDU	S4,S4,S0	;S4+=S0: p->next char in message
ADDIU	AT,R0,0003
BEQ	S5,AT,80882C88	;branch if on final row
OR	A1,R0,S0	;A1=S0: text.len
BNE	S3,R0,80882C70	;branch if count.newline not zero
ADDIU	AT,R0,0010
BNE	S0,AT,80882C88	;branch if count.str isn't max for line
NOP
//80882C70:	save final {x,y} position when newline pushes to next row
ADD.S	F6,F20,F30	;F6=ypos+16.0: next row's position
SUB.S	F4,F22,F26	;F4=xpos-160.0: lrx - position
SUB.S	F8,F28,F6	;F8=120.0 - ypos - 16.0: lry - position
SWC1	F4,0000 (S6)	;S6=xend
BEQ	R0,R0,80882CB0
SWC1	F8,0000 (S7)	;S7=yend
//80882C88:	retrieve width of string
SUBU	A0,S4,S0	;A0=S4-S0: p->current char in message
JAL	800902CC	;V0=display width of A1 characters in string A0
ADDIU	A2,R0,0000	;A2=0: width type-variable (hacked)
MTC1	V0,F16
//80882C98:	save final {x,y} position
SUB.S	F10,F28,F20	;F10=120.0 - ypos: lry-position
CVT.S.W	F4,F16	;F4=(float) width
SWC1	F10,0000 (S7)	;S7=yend
ADD.S	F6,F4,F22	;F6=width + xpos
SUB.S	F8,F6,F26	;F8=width + xpos - 160.0: lrx-position
SWC1	F8,0000 (S6)	;S6=xend
//80882CB0:	loop for 4 lines
ADDIU	S5,S5,0001	;S5++	count.row+1
ADDIU	AT,R0,0004
BNE	S5,AT,80882BB4	;loop for four lines
ADD.S	F20,F20,F30	;ypos+=16.0: next row
//80882CC0:	return
LW	RA,0094 (SP)
LDC1	F20,0040 (SP)
LDC1	F22,0048 (SP)
LDC1	F24,0050 (SP)
LDC1	F26,0058 (SP)
LDC1	F28,0060 (SP)
LDC1	F30,0068 (SP)
LW	S0,0070 (SP)
LW	S1,0074 (SP)
LW	S2,0078 (SP)
LW	S3,007C (SP)
LW	S4,0080 (SP)
LW	S5,0084 (SP)
LW	S6,0088 (SP)
LW	S7,008C (SP)
LW	S8,0090 (SP)
JR	RA
ADDIU	SP,SP,0098

80882D08	438	
	accepts: A0=p->???, A1=, A2=p->manager, A3=(float)
ADDIU	SP,SP,FFC8
SW	S1,0020 (SP)
MTC1	A3,F12
OR	S1,A0,R0
SW	RA,0024 (SP)
SW	S0,001C (SP)
SW	A2,0040 (SP)	;SP+40=A2: p->manager
LW	V0,002C (S1)
LUI	AT,0001
OR	A0,A1,R0
ADDU	V0,V0,AT
LW	S0,06E0 (V0)	;S0=V0+6E0: p->type.controller
SWC1	F12,0044 (SP)
LW	T9,06B4 (V0)
JALR	RA,T9
NOP
//80882D48:
LUI	AT,4238
MTC1	AT,F4
LUI	AT,4258
MTC1	AT,F6
LWC1	F0,0048 (SP)
LWC1	F12,0044 (SP)
LUI	AT,4320
MTC1	AT,F8		;F8= 160.0	[43200000]
SUB.S	F0,F6,F0
LUI	AT,42F0
MTC1	AT,F16		;F16= 120.0	[42F00000]
ADD.S	F12,F4,F12
MFC1	A3,F0		;A3=F0: ypos
ADDIU	T6,SP,0030
SUB.S	F18,F16,F0
MFC1	A2,F12		;A2=F12: xpos
ADDIU	T7,SP,002C
SUB.S	F10,F12,F8
SWC1	F18,002C (SP)
SW	T7,0014 (SP)
SW	T6,0010 (SP)
SWC1	F10,0030 (SP)
SWC1	F12,0044 (SP)	;SP+44=F12: xpos
SWC1	F0,0048 (SP)	;SP+48=F0: ypos
OR	A0,S0,R0	;A0=S0: p->type.controller
JAL	80882B2C	;displays message one row at a time
LW	A1,0040 (SP)	;A1=SP+40: p->manager
LWC1	F20,0048 (SP)	;F20=ypos
BEQ	S0,R0,80882E60	;skip if NULL type.controller
LWC1	F12,0044 (SP)	;F12=xpos
LH	A1,0020 (S0)	;A1=controller+20: cursor.column
LUI	AT,8088
LWC1	F8,311C (AT)	;F8=8088311C: left margin
LH	T6,0016 (S0)	;T6=controller+16: cursor.pos
SUBU	T6,T6,A1	;T6-=A1: cursor.pos-cursor.column: offset to start of cursor row
LW	A0,0024 (S0)	;A0=S0+24: p->text
JAL	800902C8	;V0=width of string
ADDU	A0,A0,T6	;A0+=T6: p->start of cursor row
MTC1	V0,F10
LW	T2,002C (S1)
LUI	T3,0001
CVT.S.W	F6,F10	;F6=(float)V0: (float)row.width
OR	A0,S1,R0
LH	T1,0022 (S0)	;T1=controller+22: cursor.row
ADD.S	F18,F6,F8	;F18=F6+F8: width + left margin
MTC1	T1,F6
ADDU	T3,T3,T2
LW	T3,06E0 (T3)	;T3=T3+6E0: p->type.controller
CVT.S.W	F8,F6	;F8=(float) cursor.row
LUI	AT,4180
MTC1	AT,F10		;F10=16.0: font height
LW	T9,002C (T3)
LW	A1,0040 (SP)	;A1=SP+40: p->manager
MUL.S	F16,F8,F10	;F16=cursor.row * 16.0: vertical spacing to row
ADD.S	F4,F18,F12	;F4=F18+F12: width + margin + xpos: final xpos
MFC1	A2,F4		;A2=final xpos
ADD.S	F18,F16,F20	;F18=F16+F20: row offset + ypos
JALR	RA,T9
MFC1	A3,F18		;A3=final ypos
//80882E34:
LW	T4,002C (S1)
LUI	T5,0001
OR	A0,S1,R0
ADDU	T5,T5,T4
LW	T5,06E0 (T5)	;T5=T5+6E0: p->type.controller
LW	A1,0040 (SP)	;A1=SP+40: p->manager
LW	A2,0030 (SP)
LW	T9,0028 (T5)
LW	A3,002C (SP)
JALR	RA,T9
NOP
//80882E60:	return
LW	RA,0024 (SP)
LW	S0,001C (SP)
LW	S1,0020 (SP)
JR	RA
ADDIU	SP,SP,0038

80882E74	5A4	
ADDIU	SP,SP,FFD8
SW	RA,001C (SP)
SW	A0,0028 (SP)
SW	A1,002C (SP)
SW	A2,0030 (SP)
SW	A3,0034 (SP)
LW	A1,0034 (SP)
LW	A0,002C (SP)
LWC1	F0,0018 (A1)
LWC1	F2,001C (A1)
MFC1	A2,F0
MFC1	A3,F2
SWC1	F0,0024 (SP)
JAL	80882A4C
SWC1	F2,0020 (SP)
LUI	AT,4366
MTC1	AT,F6
LUI	AT,40C0
MTC1	AT,F10
LWC1	F4,0024 (SP)
LWC1	F16,0020 (SP)
LW	A0,0028 (SP)
ADD.S	F8,F4,F6
LUI	T8,0001
LW	A1,0034 (SP)
SUB.S	F18,F10,F16
SWC1	F8,0010 (SP)
LW	A2,002C (SP)
LW	A3,0030 (SP)
SWC1	F18,0014 (SP)
LW	T7,002C (A0)
ADDU	T8,T8,T7
LW	T8,06D8 (T8)
LW	T9,0120 (T8)
JALR	RA,T9
NOP
//80882F04:
LW	A0,0028 (SP)
LUI	T1,0001
LW	A1,002C (SP)
LW	T0,002C (A0)
LW	A2,0030 (SP)
LWC1	F4,0020 (SP)
ADDU	T1,T1,T0
LW	T1,06E0 (T1)	;T1=T1+6E0: p->type.controller
BEQL	T1,R0,80882F3C
LW	RA,001C (SP)
LW	A3,0024 (SP)
JAL	80882D08
SWC1	F4,0010 (SP)
//80882F38:	return
LW	RA,001C (SP)
ADDIU	SP,SP,0028
JR	RA
NOP

80882F48	678	
ADDIU	SP,SP,FFE0
SW	RA,0014 (SP)
OR	A2,A1,R0
LW	T6,0000 (A2)
LUI	AT,0001
ORI	AT,AT,0118
SW	T6,001C (SP)
LW	A3,002C (A0)
SW	A2,0024 (SP)
SW	A0,0020 (SP)
ADDU	A3,A3,AT
SW	A3,0018 (SP)
LW	T9,0010 (A3)
OR	A1,A2,R0
JALR	RA,T9
NOP
//80882F88:
LW	A0,0020 (SP)
LW	A2,0024 (SP)
LW	A3,0018 (SP)
JAL	80882E74
LW	A1,001C (SP)
//80882F9C:	return
LW	RA,0014 (SP)
ADDIU	SP,SP,0020
JR	RA
NOP

80882FAC	6DC	
LW	V0,002C (A0)
LUI	AT,0001
ORI	AT,AT,0670
LUI	T6,8088
LUI	T7,8088
ADDU	V0,V0,AT	;V0+=670: 
ADDIU	T6,T6,2984	;T6=80882984
ADDIU	T7,T7,2F48	;T7=80882F48
SW	T6,0000 (V0)
SW	T7,0004 (V0)
JR	RA
NOP

80882FDC	70C	
	accepts: A0=p->struct?
ADDIU	SP,SP,FFE0
SW	RA,001C (SP)
LW	V1,002C (A0)
LUI	AT,0001
LUI	T1,8012
ADDU	AT,AT,V1
SW	R0,06A0 (AT)
LUI	AT,0001
ADDU	V0,V1,AT
LW	T8,0154 (V0)
ADDIU	T6,R0,0002
ADDIU	T7,R0,0005
SLL	T9,T8,0x2
SUBU	T9,T9,T8
SLL	T9,T9,0x2
SUBU	T9,T9,T8
SLL	T9,T9,0x2
ADDU	T9,T9,T8
SLL	T9,T9,0x3
ADDU	T9,T9,T8
SLL	T9,T9,0x3	;T9=T8*0xB48
ADDIU	T0,T9,4080	;T0=T9+4080
ADDIU	T1,T1,6EA0	;T1=80126EA0
SW	R0,011C (V0)	;0->V0+11C: 
SW	T6,0148 (V0)	;2->V0+148: 
SW	T7,014C (V0)	;5->V0+14C: 
ADDU	T2,T0,T1	;T2=8012AF20+T9: p->gyroid message
SW	T2,0010 (SP)	;SP+10=T2: p->message
ADDIU	A1,R0,000A
ADDIU	A2,R0,0001
JAL	800C4DB0
ADDIU	A3,R0,0010
//8088305C:	return
LW	RA,001C (SP)
ADDIU	SP,SP,0020
JR	RA
NOP

8088306C	79C	
ADDIU	SP,SP,FFE8
SW	RA,0014 (SP)
LUI	V1,0001
LW	V0,002C (A0)
LUI	AT,0001
ADDIU	T8,R0,0001
ADDU	T6,V0,V1
LBU	T7,0724 (T6)
ADDU	AT,AT,V0
BNE	T7,R0,808830C8
NOP
SB	T8,0724 (AT)
SW	A0,0018 (SP)
LW	T9,002C (A0)
LUI	AT,0001
ORI	AT,AT,0140
ADDU	T0,T9,V1
LW	T9,06CC (T0)
LUI	A2,8088
ADDIU	A2,A2,3114	;A2=80883114
JALR	RA,T9
ADDU	A1,V0,AT
//808830C4:
LW	A0,0018 (SP)
JAL	80882FDC
SW	A0,0018 (SP)
JAL	80882FAC
LW	A0,0018 (SP)
//808830D8:	return
LW	RA,0014 (SP)
ADDIU	SP,SP,0018
JR	RA
NOP

808830E8	818	
LW	T6,002C (A0)
LUI	AT,0001
ADDU	AT,AT,T6
SB	R0,0724 (AT)
JR	RA
NOP
